package com.jessechanrui.template.thread;

/**
 * 继承Thread线程类
 *
 * @author chenrui
 * @date 2024/12/12
 */
public class ThreadExtends extends Thread{

    private long sleepTime;
    public ThreadExtends() {
        super();
    }

    public ThreadExtends(String name) {
        super(name);
    }

    public ThreadExtends(String name, long sleepTime) {
        super(name);
        this.sleepTime = sleepTime;
    }

    public ThreadExtends(long sleepTime) {
        super();
        this.sleepTime = sleepTime;
    }




    @Override
    public void run() {
        if (sleepTime != 0L){
            ThreadUtil.sleep(sleepTime);
        }
        ThreadUtil.run("继承Thread方式-" + Thread.currentThread().getName());
    }
}
